package com.sky.mapper;

import com.github.pagehelper.Page;
import com.sky.dto.EmployeeAddDto;
import com.sky.dto.EmployeeCheckDto;
import com.sky.dto.EmployeeEditDto;
import com.sky.dto.EmployeePageDTO;
import com.sky.entity.Employee;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface EmployeeMapper {

    /**
     * 根据用户名查询员工
     * @param username
     * @return
     */
    Employee getByUsername(@Param("username") String username);

    /**
     * 分页查询
     * @param dto
     * @return
     */
    Page<Employee> pageList(EmployeePageDTO dto);

    /**
     * 校验员工数据是否重复
     * @param dto
     * @return
     */
    Employee checkRepeat(EmployeeCheckDto dto);

    /**
     * 添加员工
     * @param dto
     */
    void addEmployee(EmployeeAddDto dto);

    /**
     * 通过id查找员工
     * @param empId
     * @return
     */
    Employee getById(@Param("empId") Long empId);

    /**
     * 修改员工信息
     * @param dto
     * @return
     */
    Long editEmployee(EmployeeEditDto dto);
}
